package enums;

import java.util.function.Consumer;

public enum EnumWithCallBack2 {

    GOOD(1, System.out::println),
    NICE(2, i -> System.out.println(i.intValue() + 1)),

    ;

    private final int code;

    private Consumer<? extends Number> consumer;

    public int getCode() {
        return code;
    }

    public Consumer<? extends Number> getConsumer() {
        return consumer;
    }

    EnumWithCallBack2(int code, Consumer<? extends Number> consumer) {
        this.code = code;
        this.consumer = consumer;
    }
}
